package top.xchch.creational.decorator;

public class Main {
    public static void main(String[] args) {
        Coffee espresso = new Espresso(3);
        Decorator milk = new Milk(2);
        milk.setDrink(espresso);

        Decorator chocolate = new Chocolate(1);
        chocolate.setDrink(milk);

        System.out.println(chocolate.getDesc()); // 1 个 巧克力; 2 个 牛奶; 3 杯 意大利咖啡
        System.out.println(chocolate.cost()); // 69.7
    }
}
